<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
</head>
<body>
	<script>
		//冒泡排序
	    var arr=[];
      for(var i=0;i<10;i++){
      x=(parseInt(Math.random()*100));
      arr.push(x);
          for(var x=0;x<arr.length;x++){
              for(var y=0;y<arr.length;y++){
                  if(arr[y]>arr[y+1]){
                      var a=arr[y];
                      arr[y]=arr[y+1];
                      arr[y+1]=a;
                  }
              }
          }
      }
      alert(arr);
	</script>
</body>
</html>